home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
User's Choice Windows CD
/
User's Choice Windows CD (CMS Software)(1993).iso
/
win_m_p
/
pwez51.zip
/
SCRLFILE.DOC
< prev
next >
Wrap
Text File
|
1992-04-01
|
4KB
|
71 lines
SCROLLING THROUGH DATA FILES
An attempt to make a scroll window scroll through a large data
file may be handled in one of two ways.
1. The first involves bringing a string representation of all
of the records into the scroll window. Each record is
converted to an element of a string array which is in turn
used by routine SCRLWIND to "scroll through". This approach
is limited by the amount of free memory available to the
string array. To place 6000 records in a scroll window,
with each record requiring a string of 50 bytes to represent
it, requires 300,000 bytes of free memory. QuickBASIC is
limited to 64K of string space for variable length string
arrays. Although BASIC 7+ (PDS) does not share this
restriction by using far strings, 300,000 bytes would not
leave room available for other data or code. In the QBX
environment 300,000 bytes of free string space is not
available.
2. The second approach involves the use of "EXTENDED" scroll
windows. If an EXTENDED scroll window has seven interior
rows it is only necessary to place seven records in it at a
time. This saves 299,650 bytes of memory usage as
compared to the previous approach!! Any attempt to scroll
before the first entry or beyond the last entry in an
EXTENDED scroll window causes the scroll routine to be
exited. This gives the programmer the opportunity to
read a new record, or records, from the data file and
"refresh" the string array required by the scroll window.
Two examples are included. One uses a random access data
file. The other uses an ISAM data file. The ISAM example
may be used by users of BASIC 7+. ALTHOUGH THE ISAM EXAMPLE
CAN NOT BE USED WITH QB 4+, IT CAN BE USED AS A TEMPLATE FOR
BTRIEVE OR OTHER DATA MANAGERS.
To use the examples the data files must be "built". Two
programs MAKERAND.BAS and MAKEISAM.BAS handle this chore.
Simply load and run these programs. MAKERAND.BAS makes a
random access data file, RANDDATA.DAT. MAKEISAM.BAS makes
an ISAM data file, ISAMDATA.DAT. It requires TSR, PROISAMD.
If MAKEISAM.BAS is run and the data file, ISAMDATA.DAT,
already exists an error will be reported.
Two BASIC programs are provided which will scroll through
the newly built data files. SCRLRAND.BAS scrolls through
RANDDATA.DAT while SCRLISAM.BAS scrolls through
ISAMDATA.DAT. To use SCRLISAM.BAS, TSR, PROISAMD must be
resident. The data files should reside on a hard drive or
in a RAM drive. Although the files may be on a floppy there
will be a considerable reduction in speed if they are.
The appropriate data file ( RANDDATA.DAT or ISAMDATA.DAT )
must be in the current drive/directory. There is no error
checking for same.
The correct WINDOWS R-E-Z library must be loaded with QB or
QBX to use SCRLRAND.BAS or SCRLISAM.BAS. See the remarks at
the start of the code for details.